home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
PRG
/
Mac_F2C_1.3.2.sit
/
Mac F2C 1.3.2
/
Mac F2C Libraries
/
libI77 Sources
/
access.c
next >
Wrap
Text File
|
1995-01-28
|
707b
|
47 lines
/*
This function returns 0 if file called fileName exists,
1 otherwise.
IMT 28 Nov 94
*/
#include <Files.h>
static StringPtr CopyCtoPstr( StringPtr pStr, char *cStr );
int access( char *fileName, int notUsed )
{
OSErr err;
short vRefNum;
FInfo info;
Str255 pFileName;
CopyCtoPstr( pFileName, fileName ); /* Make name a Pascal string */
err = GetFInfo( pFileName, 0, &info ); /* Check on the default volume */
if ( err )
return 1;
else
return 0;
}
static StringPtr CopyCtoPstr( StringPtr pStr, char *cStr )
{
short i;
char *p;
i = 0;
p = ((char *) pStr) + 1;
while ( *cStr && i < 255 )
{
*p++ = *cStr++;
i++;
}
*pStr = i;
return (StringPtr) pStr;
}